package com.myhome.money.demo.nacos.dubbo;

import com.myhome.money.demo.nacos.dubbo.service.NacosConfigTestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class NacosDubboConfigMain {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[]{"classpath:provider.xml"});
        applicationContext.start();
        System.out.println("NacosDubboConfigMain启动成功!!!!");
        Thread.sleep(5000);
        NacosConfigTestBean nacosConfigTestBean = (NacosConfigTestBean) applicationContext.getBean("nacosConfigBean");
        while (true) {
            try {
                String test = nacosConfigTestBean.demo();
                System.out.println(test);
                Thread.sleep(5000);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
}
